package org.karelun.gef.model;

import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.jface.resource.FontRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.RGB;

public class RelationModel extends Node{

	private static final long serialVersionUID = 8254052814892131087L;
	
	private static int i=0;
	
	private String text="Relation"; //$NON-NLS-1$
	
	public RelationModel(){
		super();
		if(i>0)
			text="Relation"+String.valueOf(i); //$NON-NLS-1$
		i++;
		setText(text);
		setSize(new Dimension(60,30));
		
		String id=String.valueOf(System.currentTimeMillis());
        setId(id);
        
        setForeColor(new RGB(0,0,0));
        setBgColor(new RGB(182,176,195));
        
        FontRegistry fontRegistry = JFaceResources.getFontRegistry();
//        Font font = new Font(Display.getCurrent(),"Arial",20,SWT.BOLD|SWT.ITALIC);
        Font font = fontRegistry.getBold(JFaceResources.DEFAULT_FONT);
        setFontData(font.getFontData()[0]);
	}
}
